/* 
saveTag用于把搜索记录存入localStorage
*/
export function saveTags(keyword){
    let searchTag = getTags()
    if(searchTag){
        // 去重
        if(searchTag.indexOf(keyword) !== -1){
            return
        }
        searchTag.push(keyword)
    }else{
        searchTag = []
        searchTag.push(keyword)
    }
    localStorage.setItem("SEARCH_LIST", JSON.stringify(searchTag));
}

export function getTags(){
	return JSON.parse(localStorage.getItem('SEARCH_LIST')) || []
}

export function deleteTags(){
	localStorage.removeItem('SEARCH_LIST')
}